/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.isd.inventario.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Claudio
 */
@Embeddable
public class ProductoPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "STMPDH_TIPPRO", nullable = false, length = 6)
    private String tippro;
    @Basic(optional = false)
    @Column(name = "STMPDH_ARTCOD", nullable = false, length = 30)
    private String artcod;

    public ProductoPK() {
    }

    public ProductoPK(String tippro, String artcod) {
        this.tippro = tippro;
        this.artcod = artcod;
    }

    public String getArtcod() {
        return artcod;
    }

    public void setArtcod(String artcod) {
        this.artcod = artcod;
    }

    public String getTippro() {
        return tippro;
    }

    public void setTippro(String tippro) {
        this.tippro = tippro;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tippro != null ? tippro.hashCode() : 0);
        hash += (artcod != null ? artcod.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProductoPK)) {
            return false;
        }
        ProductoPK other = (ProductoPK) object;
        if ((this.tippro == null && other.tippro != null) || (this.tippro != null && !this.tippro.equals(other.tippro))) {
            return false;
        }
        if ((this.artcod == null && other.artcod != null) || (this.artcod != null && !this.artcod.equals(other.artcod))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "tv.inventario.modelo.ProductoPK[stmpdhTippro=" + tippro + ", stmpdhArtcod=" + artcod + "]";
    }

}
